---@class SkillEffect612101:BaseSkillEffect
SkillEffect612101 = ClientFight.CreateClass("SkillEffect612101",ClientFight.BaseSkillEffect)
local t = SkillEffect612101
---@param skill FightUsingSkill
---@param target Fighter
---@param result FightResult
function t:damageBefore( skill, target, result)
    local fighter = skill.fighter
    local skillBean = skill.skill.skillBean
    local skillScriptParameter = skillBean.f_SkillScriptParameter
    local maxHp = FighterAttributeManager.getFightAttr(fighter, FighterAttributeEnum.HP:getId());
    local maxLimit = calcRatio(maxHp, skillScriptParameter[1]);
    local damageSelf = math.min(fighter.hp-1,maxLimit)--最低要留一滴血
    local reducePer =  (damageSelf+0.0)/maxHp * 10000
    local step = reducePer / skillScriptParameter[2];
    if (step < 1) then
        step = 1;
    end
    local addRa = step * skillScriptParameter[3];
    local addResult = calcRatio(result.damage, addRa);
    result:setDamage(result.damage + addResult)
    if (fighter.hp - damageSelf < 1) then
        damageSelf = fighter.hp - 1;
    end
    SkillRoleMgr.savePathFile("[" .. skill.fight.frame .. "][SKILL]Fighter " .. fighter.fighterId .. " Skill"
   .. skill.skill.skillBean.f_SkillID .. " 献祭增加伤害：" .. addResult +" 增加伤害万分比: " ..addRa);
    if (damageSelf > 0) then
        DamageManager.setFighterHp(fighter.fight, fighter, fighter, skill, DamageResultTypeEnum.NORMAL, -damageSelf, fighter.hp - damageSelf,false,false,false,false);
    end

    return false;
end
t.New()